///////////////////////////////////////////////////////////////////////////////
// Common struct and macro library                                           //
// Created by Hell Hibou (2008)                                              //
// Part of Wii Homebrew Launcher                                             //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////

#ifndef _CLASS_UOBIHLLEH_WHL_COMMON
#define _CLASS_UOBIHLLEH_WHL_COMMON

typedef struct T_WHL_Common_Ressources 
{
	char				Magic [4];
	long		BlocSize;
	void (* ep_Reboot)();
	char *		Data;
	long		DataSize;
} T_WHL_Common_Ressources;


#define WHL_MAGIC "WHL\0"

#define INIT_WHL_Common_Ressources(X)											\
	((T_WHL_Common_Ressources *)X)->BlocSize = sizeof(T_WHL_Common_Ressources); \
	((T_WHL_Common_Ressources *)X)->Magic[0]  ='W';								\
	((T_WHL_Common_Ressources *)X)->Magic[1] = 'H';								\
	((T_WHL_Common_Ressources *)X)->Magic[2] = 'L';								\
	((T_WHL_Common_Ressources *)X)->Magic[3] = '\0';


#define is_WHL_Common_Ressources(X)							\
( ( ((T_WHL_Common_Ressources *)X)->Magic[0] == 'W')	&&	\
	( ((T_WHL_Common_Ressources *)X)->Magic[1] == 'H')	&&	\
	( ((T_WHL_Common_Ressources *)X)->Magic[2] == 'L')	&&	\
	( ((T_WHL_Common_Ressources *)X)->Magic[3] == '\0') )


#define GET_GLOBAL_PARAM_ADRESS	((T_WHL_Common_Ressources *) GLOBAL_PARAM_ADRESS)

#define CHANNEL_ID_SYSTEM		0x0000000100000002LL

#endif

///////////////////////////////////////////////////////////////////////////////
